/*
 * @Description:
 * @Author: william
 * @Date: 2024-08-08 11:54:37
 * @LastEditors: william
 * @LastEditTime: 2025-07-05 14:47:06
 */
// src/store/index.js
import { createPinia } from 'pinia'
import { createPersistedState } from 'pinia-plugin-persistedstate' // 数据持久化

const store = createPinia()
store.use(
  createPersistedState({
    storage: {
      getItem: uni.getStorageSync,
      setItem: uni.setStorageSync
    }
  })
)

// 全局注册 store
export function setupStore(app) {
  app.use(store)
}

export default store
